﻿<?php if(get_template_type() == 'index'){?>
    <style>
        .nch-breadcrumb-layout{
            display: none;
        }
        .my_left_category{
            display: none !important;
        }
    </style>
<div class="helps-main">
    <div class="help-menu">
        <div class="help-menulist">
 <?php
    $first = Model()->table('article_class')->select();
    foreach($first as $f){
  ?>           
<dl>
<dt><i></i><span><?php echo $f['ac_name']?></span></dt>
<dd>
<ul class="help-submenu">
        <?php

          $list = Model()->table('article')->where(array('ac_id' => $f['ac_id']))->order('article_sort')->select();
          foreach($list as $k => $ar){
        ?>
	   <li>  <a href='<?php echo urlShop('article', 'article', array('ac_id'=>$ar['article_id']));?>' id=help7><?php echo $ar['article_title']?></a></li>
      <?php }?>
		</ul>
     </dd>
</dl>
<?php }?>
        </div>
    </div>
    <div class="help-con">
        <div class="h-module">
        <?php
            $article = Model()->table('article')->find($_GET['ac_id']);
        ?>
            <div class="current-wrap">
                <?php echo $article['article_title'];?>
            </div>
            <div class="help-detail">
                <?php
                echo $article['article_content'];
              ?>
            </div>
        </div>



    </div>

</div>



<script type="text/javascript">
    $(function () {
        var theme = "selected";
        //菜单伸缩
        $(".helps-main .help-menulist dt").bind("click", function () {
            var $dl = $(this).parent();
            var time = 500;
            $dl.toggleClass(theme);
            $dl.find("dd").slideToggle(time);
            $dl.siblings().removeClass(theme);
            $dl.siblings().find("dd").slideUp(time);
        })
        //标签页 切换
        $(".tab-wrap .tab-header li").hover(function (e) {
            var index = $(this).index();
            $(this).addClass(theme).siblings().removeClass(theme);
            var $curItem = $(".tab-wrap .tab-main .tab-con").eq(index);
            $curItem.addClass(theme).siblings().removeClass(theme);
        })

        expanH(GetQueryString("helpid"));

        $('#searchcontent').keydown(function (e) {
            if (e.keyCode == 13) {
                SearchHelp();
                return false;
            }
        })
    })


    function expanH(pid) {
        pid = "help" + pid;
        $("#" + pid).closest("dl").find("dt").click();
    }

    function GetQueryString(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
        var r = window.location.search.substr(1).match(reg);
        if (r != null) return (r[2]); return null;
    }

    function SearchHelp() {
        var content = $("#searchcontent").attr("value").trim();
        if (content == null || content == undefined || content == "") {
            window.location.href = '/HelpSearch.aspx';
        }
        else {
            window.location.href = '/HelpSearch.aspx?searchcontent=' + encodeURI(content);
        }

    }

</script>


<?php } ?>

